<%@ page import="java.util.Date" %>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/layouts/taglib.jsp" %>
<!DOCTYPE html>
<html>
<head>
        <meta charset="UTF-8">
        <title>创建客服账号</title>
        <%@include file="/WEB-INF/layouts/edit-header.jsp"%>
</head>
<body>

    <div class="create-page tpanel">
        <div class="panel-content">
            <div class="container-fluid">

                <form id="createForm" class="form-horizontal">

                        <div class="form-group">
                            <label for="account" class="col-sm-2 control-label">账号</label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control"  
                                        id="account" name="account" 
                                        value="" 
                                                placeholder="请输入账号(必填)" required 

                                        minlength="0" maxlength="45" 
                                                remote="${ctx}/admin/wechat/kf-account/exist?id=${entity.id}&property=account" 
                                        />
                            </div>
                        </div>

                        <div class="form-group">
                            <label for="nickname" class="col-sm-2 control-label">昵称</label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control"  
                                        id="nickname" name="nickname" 
                                        value="" 
                                                placeholder="请输入昵称(必填)" required 

                                        minlength="0" maxlength="45" 
                                        />
                            </div>
                        </div>

                    <div class="form-group">
                        <div class="col-sm-12" style="text-align: center;">
                                <a class="btn btn-default" href="javascript:window.history.back();">返回</a>
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                <input type="submit" class="btn btn-primary" value="保存" />
                        </div>
                    </div>

                </form>

            </div>
        </div>
    </div>
                                                                        
    <script type="text/javascript">
    changeTitle('创建客服账号');
    $(function() {

        initForm('#createForm','${ctx}/admin/wechat/kf-account/create',function(r) {
            var resp = $.parseJSON(r);
            if(resp.code == 'OK') {
                changeUrl('${ctx}/admin/wechat/kf-account');
                topLayer.msg('保存成功', {icon: 1});
            }else {
                topLayer.msg(resp.message, {icon: 2});
            }
        });
    });
    </script>
</body>
</html>
